#include <iostream>
#include <signal.h>
#include <unistd.h>
using namespace std;
void sigcb(int sig)
{
    cout<<endl;
    cout << sig << "号信号正在被处理" << endl;
    exit(1);
}
int main()
{
    signal(SIGINT, sigcb);
    while (true)
    {
        cout << "hello linux!" << endl;
        sleep(1);
    }
    return 0;
}